package com.imooc.distributedemo.web3;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.web3j.protocol.Web3j;

@Component
@Slf4j
public class EthBlockScannerJob {

    @Value("${ethereum.rpc.url}")
    private String ethereumRpcUrl;

    @Value("${spring.redis.host}")
    private String redisHost;

    @Value("${spring.redis.port}")
    private int redisPort;

    @Value("${company.target.address}")
    private String targetAddress;

    private Web3j web3j;
    private StringRedisTemplate stringRedisTemplate;

    //@Scheduled(fixedRate = 12000)
    public void fetchEthPublicBlock(){
        log.info("开始扫描联网区块....");
        try{
            log.info("begin.....");
        }catch (Exception e){
            log.error("fetchEthPublicBlock处理异常",e);
        }
    }



}
